using System.Collections;
using System.Data;
using System.Windows.Forms;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.CompilerServices;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using System;
namespace ePlanSysOman
{
  public partial class frmStepWT
  {
    private void  // ERROR: Handles clauses are not supported in C#
SimpleButton1_Click(System.Object sender, System.EventArgs e)
    {
        if (Module1.newModule.stpParts)
        {
            Module1.newModule.wt = true;
        object left = Interaction.InputBox("Type location of Wire-Tie or click cancel to continue.,", "Specify location.", "Type in here the Location you want", -1, -1);
            //JMR -- Look At
        if (!Operators.ConditionalCompareObjectEqual(left, "", false)) {
            Module1.newModule.LocWireTie = left.ToString();
          if (Module1.newModule.LocWireTie == null)
            {
          } else {
              if ((Module1.newModule.LocWireTie.EndsWith("A") | Module1.newModule.LocWireTie.EndsWith("B")))
              {
                  Module1.newModule.locWireTie2 = Module1.newModule.LocWireTie;
                  Module1.newModule.LocWireTie = Module1.newModule.LocWireTie.Substring(0, (Module1.newModule.LocWireTie.Length - 1));
            } else {
                Module1.newModule.locWireTie2 = Module1.newModule.LocWireTie;
            }
          }
          this.gridStepWt.BringToFront();
          if (Module1.newModule.comp)
          {
              Module1.newModule.PartsStep = string.Concat(new string[] {
              "Locate wire tie ",
              Module1.newModule.RefWireTie,
              " near ",
              Module1.newModule.LocWireTie,
              " and remove it from aircraft."
            });
          } else {
              Module1.newModule.PartsStep = Module1.newModule.GetSelectedValues(this.GridView1);
          }
          Module1.newModule.wt = false;
          this.Dispose();
        }
      }
    }

    private void  // ERROR: Handles clauses are not supported in C#
SimpleButton2_Click(System.Object sender, System.EventArgs e)
    {
        Module1.newModule.unknown = true;
      this.Close();
    }

    private void  // ERROR: Handles clauses are not supported in C#
frmStepWT_Load(object sender, System.EventArgs e)
    {
      GridView1.SetFocusedValue(1);
      if ((Module1.newModule.comp && !Module1.newModule.FROMELEC))
      {
        this.SimpleButton3.Enabled = true;
        this.SimpleButton3.Text = "Removed note";
        if (Module1.newModule.opsisopened)
        {
          this.SimpleButton3.PerformClick();
        }
      }
      else if (Module1.newModule.comp)
      {
          Module1.newModule.FROMELEC = false;
        this.SimpleButton3.Enabled = true;
        if (Module1.newModule.opsisopened)
        {
          this.SimpleButton3.PerformClick();
        }
      }
      else if (Module1.newModule.opsisopened)
      {
        this.SimpleButton4.PerformClick();
      }
    }



    private void  // ERROR: Handles clauses are not supported in C#
GridView1_GroupRowCollapsing(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
    {
      e.Allow = false;
    }

    private void  // ERROR: Handles clauses are not supported in C#
SimpleButton4_Click(System.Object sender, System.EventArgs e)
    {
        if (Module1.newModule.stpParts)
        {
            Module1.newModule.wt = true;
            if (!Module1.newModule.opsisopened)
            {
                Module1.newModule.LocWireTie = this.GridView1.GetRowCellValue(this.GridView1.GetSelectedRows()[0], "WIRE_END_REF").ToString();
          if (Module1.newModule.LocWireTie == null) {
          } else {
              if ((Module1.newModule.LocWireTie.EndsWith("A") | Module1.newModule.LocWireTie.EndsWith("B")))
              {
                  Module1.newModule.locWireTie2 = Module1.newModule.LocWireTie;
                  Module1.newModule.LocWireTie = Module1.newModule.LocWireTie.Substring(0, (Module1.newModule.LocWireTie.Length - 1));
            } else {
                Module1.newModule.locWireTie2 = Module1.newModule.LocWireTie;
            }
          }

        }
        this.gridStepWt.BringToFront();
        if (Module1.newModule.comp)
        {
            Module1.newModule.PartsStep = string.Concat(new string[] {
            "Locate wire tie ",
            Module1.newModule.RefWireTie,
            " near ",
            Module1.newModule.LocWireTie,
            " and remove it from LRU."
          });
        } else {
            Module1.newModule.PartsStep = Module1.newModule.GetSelectedValues(this.GridView1);
        }
        Module1.newModule.wt = false;
        this.Dispose();
      }
    }

    private void  // ERROR: Handles clauses are not supported in C#
SimpleButton3_Click(object sender, System.EventArgs e)
    {
        Module1.newModule.BAckhrn = true;
      this.Close();
    }

    private void gridStepWt_Click(object sender, EventArgs e)
    {

    }

      public frmStepWT()
    {
        InitializeComponent(); 
    }
  }
}

